﻿using Api.Application;
using System.Collections.Generic;
using System.Web.Http;
using Api.Code;

namespace Api.OrderFood.Controllers
{
    public class FoodTypeController : ApiControllerBase
    {
        Sys_TypeApp Sys_TypeApp = new Sys_TypeApp();

        [HttpGet]
        public IHttpActionResult ReturnFoodTypeWithGet(string keyValue = "")
        {
            if (string.IsNullOrEmpty(keyValue))
            {
                return Error(ReturnCode.NOPARAMETER);
            }
            else
            {
                var data = Sys_TypeApp.GetEntity(keyValue);
                return Success(data);
            }
        }

        [HttpGet]
        public IHttpActionResult ReturnFoodTypeListWithGet()
        {
            var data = Sys_TypeApp.GetList();
            return Success(data);
        }
    }
}
